<div id="main_content" style="float: left; background: #fff;">
    <h3><?php echo $title;?></h3>
    <div class="form_search" style="width:455px;">
    <table width="500">
    	<tr>
            <td>
                <form name="frmEmploryeSearch" class="frmEmploryeSearch" method="POST" action="">
                    <label><?php echo $this->lang->line('User_Name'); ?></label>
                    <input type="text" name="txtName" value="<?php if(isset($FullName))echo $FullName; ?>" />  
                    <label><?php echo $this->lang->line('User_Role'); ?></label>
                    <select name="cboRole">
                        <option value="0" <?php if(isset($Level)&&$Level==''){echo "selected='selected'";}?>><?php echo $this->lang->line('User_All'); ?></option>
                        <option value="2" <?php if(isset($Level)&&$Level==2){echo "selected='selected'";}?>><?php echo $this->lang->line('User_HR'); ?></option>
                        <option value="1" <?php if(isset($Level)&&$Level==1){echo "selected='selected'";}?>><?php echo $this->lang->line('User_Admin'); ?></option>
                    </select>
                    <input type="submit" name="btnSubmit" value="<?php echo $this->lang->line('User_Search'); ?>" class="btnSubmit" />
                </form>
            </td>
        </tr>
    </table>
    </div>
    <a href="<?php echo base_url();?>user/add" class="new_regis"><?php echo $this->lang->line('User_Newregister'); ?></a>
    <div class="table_list userlist">
    	<table border="0"  class="list_view_data" cellpadding="0" cellspacing="0" width="100%">
            <tr align="center">
                <th width="5%"><?php echo $this->lang->line('User_No'); ?></th>
                <th width="20%"><?php echo $this->lang->line('User_FullName'); ?></th>
                <th width="5%"><?php echo $this->lang->line('User_Role'); ?></th>
                <th width="20%"><?php echo $this->lang->line('User_UserName'); ?></th>
                <th width="20%"><?php echo $this->lang->line('User_Email'); ?></th>
                <th width="10%"><?php echo $this->lang->line('User_Status'); ?></th>
                <th width="10%"><?php echo $this->lang->line('User_Action'); ?></th>
                <th width="10%"><?php echo $this->lang->line('spl__Delete'); ?></th>
            </tr>
            <?php
            if (count($data)){
            $count = 1;
		foreach($data as $row){
                $path=($row['Del_Flag']==0) ? base_url()."public/sites/images/check-icon.png" : base_url()."public/sites/images/uncheck.gif";
            ?>
            <tr>
            	<td class="table_col"><?php echo $count; ?></td>
                <td width="150" class="table_col">
                    <a href="javascript:void(0);" rel="<?php echo $row['UserId']; ?>" class="h_td_name post_id" title="<?php echo dQuotes($row['FullName']); ?>">
                        <?php echo dQuotes(subString($row['FullName'])); ?>
                    </a>
                </td>
                <td width="50"  class="table_col">
                    <?php 
                        if($row['Level']==1){
                            echo "<span title='".dQuotes($this->lang->line('User_Admin'))."'>";
                            echo dQuotes(subString($this->lang->line('User_Admin')));
                            echo "</span>";
                        }
                        else{
                            echo "<span title='".dQuotes($this->lang->line('User_HR'))."'>";
                            echo dQuotes(subString($this->lang->line('User_HR')));
                            echo "</span>";
                        }
                    ?>
                </td>
                <td class="table_col">
                    <span title="<?php echo dQuotes($row['UserName']); ?>">
                    <?php echo dQuotes(subString($row['UserName'])); ?>
                    </span>
                </td>
                <td width="200" class="table_col">
                    <span title="<?php echo dQuotes($row['Email']); ?>">
                    <?php echo dQuotes(subString($row['Email'])); ?>
                    </span>
                </td>
                <td align="center">
                <?php 
                    if($row['Status']==1){
                        ?>
                            <img src="<?php echo base_url();?>public/sites/images/check-icon.png" width="15" />
                        <?php
                    }
                    else{
                        ?>
                            <img src="<?php echo base_url();?>public/sites/images/uncheck.gif" width="15" />
                        <?php
                    }
                ?>
                </td>
                <td align="center"><a href="javascript:void(0);" rel="<?php echo $row['UserId']; ?>" class="post_id"><img src="<?php echo base_url();?>public/sites/images/Pencil.png" width="15" /></a></td>
                <td align="center"><img src="<?php echo $path;?>"/></td>
            </tr>
            <?php $count ++; } ?>                                                                    
        </table>
        <?php } 
            else{
        ?>
        </table>
        <p><?php echo $this->lang->line('LR_null'); ?></p>
        <?php
            }
        ?>
    </div>
    <div class="pagination">
        <?php echo $pagi;  ?>
    </div>    
</div>
<form id="frmSubmit" action="<?php echo base_url();?>user/edit" Method="POST">
  <input type="hidden" id="hidID" name="id">  
</form>
<script type="text/javascript">
    $( ".post_id" ).click(function() {     
         $('#hidID').val($(this).attr('rel'));
         $( "#frmSubmit" ).submit();
    });    
    $(document).ready(function() {
        $('.pagination a').click(function(e) {
            e.preventDefault();
            var url = $(this).attr('href');
            if (url != 'javascript:void(0)') {
                $('.frmEmploryeSearch').attr('action', url);
                $('.frmEmploryeSearch').submit();
            }
        });
        $('.btnSubmit').click(function(e) {
            e.preventDefault();
            $('.frmEmploryeSearch').attr('action', '/user');
            $('.frmEmploryeSearch').submit();
        });
    });
</script>